0 CLS:CLEAR1000:DIMC1,CC,M$,MC,C(26,26),A(5,4),B(5,4),M$(26),K(255),X,Y,V,O,L,P,I$,LV,TM:MC=16384:GOTO1000
7 PRINTM$;:CC=((PEEK(17024)AND1)*256+PEEK(17025))-1+MC:FORC1=CC-LEN(M$)+1TOCC:POKEC1,PEEK(C1)-64:NEXT:RETURN
10 PRINTTAB(10)"MAP MAKER FOR":PRINTTAB(1);:M$="CAVES OF THE UNWASHED HEATHEN":GOSUB7
20 PRINT:PRINTTAB(5)"MC-10 VER. JIM GERRIE":PRINT:PRINT:PRINT"EDIT WHICH DUNGEON LEVEL?"
21 PRINT"(1) LVL1DATA"
22 PRINT"(2) LVL2DATA"
23 PRINT"(3) LVL3DATA"
24 PRINT"(4) LVL4DATA":PRINT"(Q) QUIT TO BASIC"
25 I$=INKEY$:IFI$=""THEN25
26 IFI$="1"THENCLS:PRINT@198,"LOAD LEVEL 1 DATA...":LOAD*C,"LVL1DATA":LV=1:GOTO40
27 IFI$="2"THENCLS:PRINT@198,"LOAD LEVEL 2 DATA...":LOAD*C,"LVL2DATA":LV=2:GOTO40
28 IFI$="3"THENCLS:PRINT@198,"LOAD LEVEL 3 DATA...":LOAD*C,"LVL3DATA":LV=3:GOTO40
29 IFI$="4"THENCLS:PRINT@198,"LOAD LEVEL 4 DATA...":LOAD*C,"LVL4DATA":LV=4:GOTO40
30 IFI$<>"Q"THEN25
31 CLS:END
40 CLS0:GOSUB4000
50 PRINT@0,"PLEASE WAIT...";:FORY=1TO25:FORX=1TO25:M$(Y)=M$(Y)+CHR$(K(C(X,Y))):IFC(X,Y)<>0THENSET(X+32,Y+2,2)
51 NEXT:NEXT:IFC(0,25)THENV=VARPTR(M$(C(0,26))):POKE(PEEK(V+2)*256)+PEEK(V+3)+C(0,25)-1,76:SOUND200,1
52 CLS0:GOSUB3000:GOSUB2000:X=2:Y=2
55 FORCC=1TO25:I$=INKEY$:PRINT@32*Y+X-1,"\9f";:IFI$<>""THENPRINT@32*Y+X-1,MID$(M$(Y+O),X,1);:CC=50:NEXT:GOTO60
56 NEXT:FORCC=CCTO50:I$=INKEY$:PRINT@32*Y+X-1,MID$(M$(Y+O),X,1);:IFI$<>""THENCC=50:NEXT:GOTO60
58 NEXT:GOTO55
60 IFI$="S"THENX=X+1:IFX>24THENX=24:GOTO75
62 IFI$="A"THENX=X-1:IFX<2THENX=2:GOTO75
63 IFI$="W"THENY=Y-1:IFY<2THENTM=Y:Y=2:IFTM+O=13THENGOSUB2000:Y=13
64 IFI$="Z"THENY=Y+1:IFY>13THENTM=Y:Y=13:IFTM+O=14THENGOSUB2010:Y=2
65 IFI$=" "THENV=VARPTR(M$(Y+O)):L=(PEEK(V+2)*256)+PEEK(V+3)+X-1:P=PEEK(L):POKEL,32:IFP=76THENC(0,25)=0
66 IFI$="B"THENV=VARPTR(M$(Y+O)):L=(PEEK(V+2)*256)+PEEK(V+3)+X-1:P=PEEK(L):POKEL,128:IFP=76THENC(0,25)=0
67 IFI$="C"THENV=VARPTR(M$(Y+O)):L=(PEEK(V+2)*256)+PEEK(V+3)+X-1:P=PEEK(L):POKEL,67:IFP=76THENC(0,25)=0
68 IFI$="U"THENV=VARPTR(M$(Y+O)):L=(PEEK(V+2)*256)+PEEK(V+3)+X-1:P=PEEK(L):POKEL,85:IFP=76THENC(0,25)=0
69 IFI$="D"THENV=VARPTR(M$(Y+O)):L=(PEEK(V+2)*256)+PEEK(V+3)+X-1:P=PEEK(L):POKEL,68:IFP=76THENC(0,25)=0
70 IFI$="/"THENV=VARPTR(M$(Y+O)):L=(PEEK(V+2)*256)+PEEK(V+3)+X-1:P=PEEK(L):POKEL,47:IFP=76THENC(0,25)=0
71 IFI$="L"THENON-(C(0,25)>0)GOTO80:V=VARPTR(M$(Y+O)):POKE(PEEK(V+2)*256)+PEEK(V+3)+X-1,76:C(0,25)=X:C(0,26)=Y+O
72 IFI$="Q"THEN100
75 PRINT@25,MID$(STR$(X),2)"/"MID$(STR$(Y+O),2)" ";:GOTO55
80 SOUND1,1:GOTO75
100 PRINT@32*15+25,"SAVE?";
110 I$=INKEY$:IFI$="N"THEN140
120 IFI$="Y"THEN180
130 GOTO110
140 PRINT@32*15+25,"QUIT?";
150 I$=INKEY$:IFI$="N"THENPRINT@32*15+25,"\80\80\80\80\80";:GOTO55
160 IFI$="Y"THENCLS:END
170 GOTO150
180 CLS0:PRINT"PLEASE WAIT...";:FORY=1TO25:FORX=1TO25:C(X,Y)=K(ASC(MID$(M$(Y),X,1))):IFC(X,Y)<>0THENSET(X+32,Y+2,2)
190 NEXT:NEXT:PRINT@64,"READY CASSETTE,";:PRINT@96,"THEN HIT ENTER ";
195 I$=INKEY$:IFI$<>CHR$(13)THEN195
200 IFLV=1THENCLS:PRINT@198,"SAVING LEVEL 1 DATA...":SAVE*C,"LVL1DATA"
210 IFLV=2THENCLS:PRINT@198,"SAVING LEVEL 2 DATA...":SAVE*C,"LVL2DATA"
220 IFLV=3THENCLS:PRINT@198,"SAVING LEVEL 3 DATA...":SAVE*C,"LVL3DATA"
230 IFLV=4THENCLS:PRINT@198,"SAVING LEVEL 4 DATA...":SAVE*C,"LVL4DATA"
240 CLS0:GOSUB3000:GOSUB2000:X=2:Y=2:GOTO140
1000 K(0)=128:K(1)=32:K(2)=47:K(3)=85:K(4)=68:K(5)=67
1010 K(128)=0:K(32)=1:K(47)=2:K(85)=3:K(68)=4:K(67)=5:K(76)=2
1999 GOTO10
2000 O=0:FORY=2TO13:PRINT@32*Y,M$(Y);:NEXT:RETURN
2010 O=12:FORY=14TO25:PRINT@32*(Y-O),M$(Y);:NEXT:Y=2:RETURN
3000 PRINT@32*2+25,;:M$="A=LEFT ":GOSUB7
3010 PRINT@32*3+25,;:M$="S=RIGHT":GOSUB7
3020 PRINT@32*4+25,;:M$="W=UP   ":GOSUB7
3030 PRINT@32*5+25,;:M$="Z=DOWN ":GOSUB7
3040 PRINT@32*6+25,;:M$=" =CLEAR":GOSUB7
3050 PRINT@32*7+25,;:M$="B=WALL ":GOSUB7
3060 PRINT@32*8+25,;:M$="C=CHEST":GOSUB7
3070 PRINT@32*9+25,;:M$="U=STR.U":GOSUB7
3080 PRINT@32*10+25,;:M$="D=STR.D":GOSUB7
3090 PRINT@32*11+25,;:M$="/=DOOR ":GOSUB7
3091 PRINT@32*12+25,;:M$="L=LOCK ":GOSUB7
3092 PRINT@32*13+25,;:M$="Q=SAVE ":GOSUB7
3099 RETURN
4000 PRINT@32*2,;:M$="SOME ADVICE:   ":GOSUB7
4010 PRINT@32*3,"ONLY PASSAGES  ";
4020 PRINT@32*4,"WILL RENDER    ";
4030 PRINT@32*5,"PROPERLY-- NOT ";
4040 PRINT@32*6,"ROOMS. PLACE UP";
4050 PRINT@32*7,"AND DOWN STAIRS";
4060 PRINT@32*8,"WHERE THEY WILL";
4070 PRINT@32*9,"CONNECT WITH   ";
4080 PRINT@32*10,"OPPOSITE STAIR ";
4090 PRINT@32*11,"ON THE NEXT LV.";
4091 PRINT@32*12,"YOU CAN ONLY   ";
4092 PRINT@32*13,"HAVE ONE LOCKED";
4093 PRINT@32*14,"DOOR 'L' PER   ";
4094 PRINT@32*15,"LEVEL.         ";
4099 RETURN
